{% extends 'IcsocUIBundle::page.html.twig' %}
{% from 'IcsocUIBundle:Macro:grid.html.twig' import gridWidth,gridNav,gridConfig,gridKeyword,sendKeyWord %}
{% block stylesheet %}
    {{ parent() }}
    {% stylesheets
    '@jqgird_css'
    '@jquery_ui_css'
    '@gritter_css'
    filter='cssrewrite' filter='uglifycss'
    %}
    <link rel="stylesheet" href="{{ asset_url }}" />
    {% endstylesheets %}
{% endblock %}

{% block content %}
    {{ gridKeyword('Keyword'|trans,'Search Keyword'|trans) }}
    <table id="grid-table"></table>
    <div id="grid-pager"></div>
{% endblock %}
{% block footer %}
    {% javascripts
    '@jqgird_js'
    '@gritter_js'
    '@jquery_ui_js'
    '@common_js'
    filter='uglifyjs'
    %}
    <script src="{{ asset_url }}"></script>
    {% endjavascripts %}
    <script type="text/javascript">
        jQuery(function($) {
            {{ gridWidth() }}
            jQuery(grid_selector).jqGrid({
                url: "{{ path('icsoc_evaluate_list') }}",
                colNames:['{{ 'actions'|trans }}', 'ID', '{{ 'Evaluate Name'|trans }} ','{{ 'Evaluate Sound'|trans }}','{{ 'Evaluate Play Order'|trans }}','{{ 'Evaluate Retry Times'|trans }}','{{ 'Evaluate Valid Keys'|trans }}'],
                colModel:[
                    {name:'myac',index:'', width:40, sortable:false, resize:false,align:'center',
                        formatter:'actions',
                        formatoptions:{
                            keys:true,
                            editbutton:true,
                            editformbutton: true,
                            delOptions:{recreateForm: true, beforeShowForm:beforeDeleteCallback, afterSubmit:afterDeleteCallback,left:540,top:206},
                            editOptions:{width: "0",height: "0", jqModal:false, beforeShowForm:beforeEditCallback }
                        }
                    },
                    {name:'id',index:'id', width:60, hidden:true,editable: true, sortable:false},
                    {name:'name',width:140,index:'next_wait', editable:true, sortable:true },
                    {name:'sound_id',index:'sound_id',width:140,editable:true, sortable:true},
                    {name:'play_order',index:'play_order',width:40,editable:true, sortable:true },
                    {name:'retry_times',width:40,index:'retry_times', editable:true, sortable:true },
                    {name:'valid_keys',width:80,index:'valid_keys',editable:true, sortable:false }
                ],
                {{ gridConfig() }}
                sortname: 'id',
                editurl: "{{ path('icsoc_evaluate_delete') }}",
                caption: "{{ 'Evaluate List'|trans }}"
            });
            {{ gridNav(false,false,true,false,true,true,path('icsoc_evaluate_add'),path('icsoc_evaluate_editOrigin')) }}
        });

        {{ sendKeyWord() }}
        $(document).ready(function(){
            $('#keyword').tooltip();
        });
    </script>
{% endblock %}